#include<iostream>
#include<vector>
class StrHelper{
    public:
    static size_t stringSpilt(const std::string& str,const std::string& seq,std::vector<std::string>& str_array) {
            if (seq.empty()){
                // 如果分隔符为空，直接将整个字符串作为结果
                str_array.push_back(str);
                return str_array.size();
            }
            int pos = 0, idx = 0;
            while (idx < str.size()){
                pos = str.find(seq, idx);
                if (pos == std::string::npos){
                    str_array.push_back(str.substr(idx));
                    return str_array.size();
                }

                if (pos == idx){
                    idx = pos + seq.size();
                    continue;
                }
                str_array.push_back(str.substr(idx, pos - idx));
                idx = pos + seq.size();
            }
            return str_array.size();
    }
 };

 int main(){
    std::vector<std::string> test;
    std::string tagg="news.*.*.music.pop";
    StrHelper::stringSpilt(tagg,".",test);
    for(auto& x:test){
        std::cout<<x<<" ";
    }
    return 0;
 }